package modelo;

public final class Pair<A extends Comparable<A>, B extends Comparable<B>> implements Comparable<Pair<A, B>> {
	public final A first;
	public final B second;

	public Pair(A first, B second) {
		super();
		this.first = first;
		this.second = second;
	}

	@Override
	public int compareTo(Pair<A, B> right) {
		int r;
		
		r = first.compareTo(right.first);
		if (r != 0) return r;
		
		r = second.compareTo(right.second);
		if (r != 0) return r;
		
		return 0;
	}
}